<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
		/*function startTime(){
			initTime();
			window.setInterval("initTime()",1000);
		}*/
		var timer;
		function startTime(){
			initTime();
			timer=window.setInterval(function(){
				var t=document.getElementById("clock");
		 		t.innerHTML=new Date().toLocaleString();
			},1000);
		}
		function initTime(){ 
		 	var t=document.getElementById("clock");
		 	t.innerHTML=new Date().toLocaleString();
		}
		function stopTimer(){
			window.clearInterval(timer);
		}
		</script>
	</head>
	<body onload="startTime()">
		<h2 align="center" id="clock"></h2>
		<input type="button" value="stop" ondblclick="stopTimer()"/>
	</body>
</html>
